package com.igor.bookStore.tapestry.pages;

import java.util.LinkedList;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.igor.bookStore.beans.CustomerBean;
import com.igor.bookStore.inface.Customer;
import com.igor.bookStore.inface.Purchase;
import com.igor.bookStore.service.Customers;

public class EntryCustomer {
    @Property
    @Persist
    private Customer customer;
   
    @Inject
    private Customers customers;
   
    @SetupRender
    public void createObject() {
        customer = new CustomerBean();
            customer.setPurchases(new LinkedList<Purchase>());
    }
   
    public void onSuccess() {
    	 customer.executeCustomerCreation(customers);
    }
}

